home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_vol_torchcrackle.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  105 lines

  1. # Jones 3D Cog Script
  2. #
  3. # CYN_StrutSight.cog
  4. #
  5. #    [cmg]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13.     message     startup
  14.     message     crossed
  15.     message     pulse
  16.     
  17.     #    props
  18.     thing    sparkpos
  19.     
  20.     # triggers
  21.     surface        on_cross            linkId=2
  22.     surface        on_cross1            linkId=2
  23.     
  24.  
  25.     surface        off_cross            linkId=3
  26.     surface        off_cross1            linkId=3
  27.  
  28.     
  29.     # sounds
  30.     sound       fiery=gen_torch_burnin_c.wav        local    #crackling torch sound
  31.     
  32.     #    templates
  33.     template    sparks=flamesparks1                    local                  
  34.     
  35.     #    variables
  36.     int            lit=0                
  37.     
  38.     
  39. end
  40.  
  41. # ========================================================================================
  42.  
  43. code
  44.  
  45. startup:
  46.  
  47.     Sleep(0.25);
  48.     If (lit == 1)
  49.     {
  50.         PlaySoundThing(fiery, sparkpos, 1, 4, 10, 0x81);
  51.         SetPulse(1.0);
  52.     }
  53.  
  54.     return;
  55.  
  56.  
  57. # ========================================================================================
  58. pulse:
  59.  
  60.     If (lit == 0) return;
  61.  
  62.     If (lit == 1)
  63.     {
  64.         if ( Rand() < 0.50 )
  65.         {
  66.             CreateThing(sparks, sparkpos);
  67.         }
  68.     }
  69.  
  70.     return;
  71.  
  72. # ========================================================================================
  73. crossed:
  74.  
  75.     If (GetSenderID() == 2)
  76.     {
  77.         If (lit != 1) 
  78.         {
  79.             StopAllSoundsThing(sparkpos);
  80.             lit = 1;
  81.             PlaySoundThing(fiery, sparkpos, 1, 4, 10, 0x81);
  82.             SetPulse(1.0);
  83.         }
  84.         else return;
  85.     }
  86.  
  87.     If (GetSenderID() == 3)
  88.     {
  89.         If (lit != 0) 
  90.         {
  91.             lit = 0;
  92.             StopAllSoundsThing(sparkpos);
  93.             SetPulse(0);
  94.         }
  95.         else return;
  96.     }
  97. return;
  98.  
  99.  
  100. # ========================================================================================
  101.  
  102.  
  103. end
  104.  
  105.